import java.util.Scanner;

public class Add implements func{
    public void work (BookList bookList){
        Scanner scanner = new Scanner(System.in);
        System.out.println("添加图书");
        System.out.println("输入名字");
        String name = scanner.nextLine();
        System.out.println("输入价格");
        int prince =scanner.nextInt();
        System.out.println("输入作者");
        String writer = scanner.nextLine();
        System.out.println("输入类型");
        String type = scanner.nextLine();
        int size = bookList.getSize();
        bookList.books[size]= new Book(name,prince,writer,type);
        size++;
        bookList.setSize(size);
    }




}
